import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import net.sf.json.JSON;
import net.sf.json.xml.XMLSerializer;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String xml = "";
		try {
			FileReader fr = new FileReader(new File("a.xml"));
			BufferedReader bfr = new BufferedReader(fr);
			String n = null;
			while((n = bfr.readLine()) != null){
				xml += n;
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		
		System.out.println(xml);
		
		XMLSerializer xmlSerializer = new XMLSerializer();   
		JSON json = xmlSerializer.read( xml );   
		System.out.println( json.toString(2) );   
	}

}
